<template>
  <div>
    <!-- <div style="border: 5px solid #000000">
      <el-button type="primary" @click="loginSuccess">回跳测试</el-button>
    </div>-->

    <div id="app">
      <Login @loginSuccess="loginSuccess()" />
    </div>
  </div>
</template>

<script>
import Login from "@/components/Login";

export default {
  name: "App",
  data() {
    return {
      originUrl: "",
    };
  },
  components: {
    Login,
  },
  methods: {
    // debug1() {
    //   window.open("http://localhost:8080/#/?produceId=" + this.produceId);
    // },
    // debug2() {
    //   var url = process.env.URL_HEAD + "/touser/user/page/test";
    //   var user = {
    //     userId: 103,
    //     userName: 1,
    //     phoneNumber: 1,
    //     password: 1,
    //     email: 1,
    //     points: 1,
    //     userType: 1,
    //   };

    //   this.$http.post(url, user, { withCredentials: true }).then(
    //     (response) => {},
    //     (response) => {}
    //   );
    // },
    loginSuccess() {
      window.location.href = this.originUrl;

      // window.open(this.originUrl);
    },
  },
  created() {
    var originUrl = this.$route.query.originUrl;

    if (originUrl != null && originUrl.trim().length != 0) {
      this.originUrl = originUrl;
    } else {
      this.originUrl = process.env.DEFAULT_URL;
    }
  },
};
</script>

<style scoped>
/* #app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */
</style>
